/**********************************************************
** Replication file for Ban, Palmer and Schneer 2019     **
** file: analyze_officeholder_lobbying.do                **
** date: 5/29/2019                                       **
**********************************************************/

*set working dir
cd "/nfs/home/B/bschneer/shared_space/bschneer/lobbying_replication"

clear all
set more off

*Loop regressing lobby outcomes on MC characteristics

foreach item in house senate{

use "inputs/`item'_appendix.dta", clear

*Committee Memberships
local spec1 committee_* ln_time_in_office

*Leadership Roles
local spec2 Committee_chair Committee_rm party_leader ln_time_in_office

*Pre-Existing Wealth and Previous Employment
local spec3 ln_wealth military job4 job11

*Ideology
local spec4 dwnom*

local label1 "Committee Memberships"
local label2 "Leadership Roles"
local label3 "Previous Employment and Wealth"
local label4 "Ideology"
}


foreach item in house senate{
use "inputs/`item'_appendix.dta", clear
local label0 = proper("`item'")
forvalues n=1(1)4{
foreach outcome of varlist became_lobbyist ln_lobbying_reports ln_amount_per_lobbyist ln_amount_weighted_lim {
reg `outcome' `spec`n'', robust
estimates store `outcome'_all
}

esttab *_all using "out/descriptive_`item'_`n'_all_updated.tex", longtable ///
star(* 0.10 ** 0.05 *** 0.01) r2 se label compress title("Determinants of Lobbying Characteristics Among Members of the `label0': `label`n'' \label{all`item'`n'}") replace

}
}


